package com.buercorp.wangyu.socket.tcpdemo05;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

/**
 * 多发多收
 * @author liyiyu
 */
public class Client {
    public static void main(String[] args) throws IOException {
        // 创建对象连接服务器
        Socket socket = new Socket("127.0.0.1",13333);
        // 写出数据
        Scanner sc = new Scanner(System.in);
        OutputStream os = socket.getOutputStream();

        while (true) {
            System.out.println("请输入你输入的信息");
            String str = sc.nextLine();
            if ("886".equals(str)){
                break;
            }
            os.write(str.getBytes());

        }

        socket.close();
    }
}
